﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace VRacer
{
    /// <summary>
    /// Zawiera podstawowe funkcje pozwalajace wyznaczyc kolejny ruch tak aby byl optymalny. Musi zawierać referencje do obiektu gry.
    /// Metoda <c>Distance</c> sprawdza odległóść od danego miejsca do ściany w określonym przez wektor kierunku.
    /// </summary>
    /*public abstract class PathFinderPlayer : PlayerBase
    {
        protected Game _gra;

        public PathFinderPlayer(Game game)
        {
            _gra = game;
        }


        protected Point wektor, _position, _speed;
        protected int _color;

        private int Distance(Point _point)
        {
            int nowy_color;
            if (_gra.CurrentTrack.GetFinishCrossPoint(_position.X, _position.Y, _position.X + _speed.X + _point.X, _position.Y + _speed.Y + _point.Y).X != -1)
                nowy_color = 101 * 256 * 256;
            else if  (_gra.CurrentTrack.GetStartCrossPoint(_position.X, _position.Y, _position.X + _speed.X + _point.X, _position.Y + _speed.Y + _point.Y).X != -1)
                nowy_color = 0;
            else
            {
                //nowy_punkt = _gra.CurrentTrack.GetDistance(Position.X, Position.Y, Position.X + Speed.X + _point.X, Position.Y + Speed.Y + _point.Y);
                //nowy_punkt = _gra.FindPointAfterCollision(nowy_punkt, _gra.ActivePlayer);
                //nowy_color = AIDraw.GetColor((int)nowy_punkt.X, (int)nowy_punkt.Y, _gra.CurrentTrack);
                nowy_color = AIDraw.GetColor((int)(_position.X + _speed.X + _point.X), (int)(_position.Y + _speed.Y + _point.Y), _gra.CurrentTrack);
            }
            return nowy_color;
        }

        protected void FindWay()
        {
            int color,x,y;
            _color = 0;
            _position.X = Position.X;
            _position.Y = Position.Y;
            _speed.X = Speed.X;
            _speed.Y = Speed.Y;

            wektor.X = 0;
            wektor.Y = 0;

            for (x = -1; x <= 1;x++ )
            {
                for (y = -1; y <= 1; y++)
                {
                    color = Distance(new Point(x, y));
                    if (color > _color)
                    {
                        _color = color;
                        wektor = new Point(x, y);
                    }
                }
            }
        }
    }*/
}
